﻿using MiscHelper;
using NUnit.Framework;

namespace MiscHelperTest
{
    //  + 856 + (0)36
    class PhoneNumberUT
    {
        [Test]
        public void NullField()
        {
            var l = PhoneNumber.Sanitize(null);
            Assert.AreEqual("", l);
        }

        [Test]
        public void GoodNumber()
        {
            var l = PhoneNumber.Sanitize("+ 856 + (0)36 511 856");// check there's no tampering with final 856
            Assert.AreEqual("+856 (0)36 511 856", l);
        }

        [Test]
        public void Sample1()
        {
            var l = PhoneNumber.Sanitize("856 023 511088");
            Assert.AreEqual("+856 (0)23 511 088", l);
        }

        [Test]
        public void Sample2()
        {
            var l = PhoneNumber.Sanitize("856 23 511 035");
            Assert.AreEqual("+856 (0)23 511 035", l);
        }

        [Test]
        public void Sample3WithASlash()
        {
            var l = PhoneNumber.Sanitize("856 023 511 598/99");
            Assert.AreEqual("+856 (0)23 511 598/99", l);
        }

        [Test]
        public void Sample4()
        {
            var l = PhoneNumber.Sanitize("030 5347 603");
            Assert.AreEqual("+856 (0)30 534 7603", l);
        }

        [Test]
        public void Sample5()
        {
            var l = PhoneNumber.Sanitize("856 41 252 188-199");
            Assert.AreEqual("+856 (0)41 252 188-199", l);
        }

        [Test]
        public void Sample6()
        {
            var l = PhoneNumber.Sanitize("856 41 212 445/252097");
            Assert.AreEqual("+856 (0)41 212 445/252097", l);
        }

        [Test]
        public void Sample7()
        {
            var l = PhoneNumber.Sanitize("85621213514");
            Assert.AreEqual("+856 (0)21 213 514", l);
        }

        [Test]
        public void Sample8()
        {
            var l = PhoneNumber.Sanitize("0");
            Assert.AreEqual("", l);
        }
    }
}
